package com.training.java.core.collections.post15;

public class TelevisionMutable implements Comparable<TelevisionMutable> {

	private String company;
	private String type;
	private boolean enabled3D;
	private int price;

	TelevisionMutable(String company, String type, boolean enabled3D, int price) {
		this.company = company;
		this.type = type;
		this.enabled3D = enabled3D;
		this.price = price;
	}

	public void setCompany(String company) {
		this.company = company;
	}

	public void setType(String type) {
		this.type = type;
	}

	public void setEnabled3D(boolean enabled3d) {
		enabled3D = enabled3d;
	}

	public void setPrice(int price) {
		this.price = price;
	}

	public String getCompany() {
		return company;
	}

	public String getType() {
		return type;
	}

	public boolean isEnabled3D() {
		return enabled3D;
	}

	public int getPrice() {
		return price;
	}

	@Override
	public boolean equals(Object obj) {

		TelevisionMutable that = (TelevisionMutable) obj;

		if (this.company.equals(that.company) && this.type.equals(that.type)
				&& this.price == (that.price)) {

			return true;
		} else {
			return false;

		}
	}

	@Override
	public int hashCode() {

		return company.hashCode() + type.hashCode();
	}

	@Override
	public int compareTo(TelevisionMutable that) {

		return this.company.compareTo(that.company);
	}

}
